﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

using DAPNet;

namespace Benchmark
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Wave originalWav = new Wave();
            originalWav.Read("drums-original.wav");
            SampleCollection samples = originalWav[0];
            Wave clickingWav = new Wave();
            clickingWav.Read("drums-clicking.wav");
            SampleCollection clicking = clickingWav[0];
            double noiseTreshold = 0.02;
            SimpleGate gate = new SimpleGate(noiseTreshold);
            gate.Process(clicking);

            NaiveDetector detector = new NaiveDetector(0.95, 5);
            ClickDetectionTest test = new ClickDetectionTest(detector, samples, clicking);
            ClickDetectionStats stats = test.Run();
            Application.Run(new ClickDetectionStatsViewForm(stats));

            //NaiveCorrector corrector = new NaiveCorrector();
            //ClickCorrectionTest test = new ClickCorrectionTest(corrector, samples, clicking);
            //ClickCorrectionStats stats = test.Run();
            //Application.Run(new ClickCorrectionStatsViewForm(stats));
        }
    }
}
